<?php

/**
 * sfGuardUserProfile form base class.
 *
 * @method sfGuardUserProfile getObject() Returns the current form's model object
 *
 * @package    BuLaBuSys2013
 * @subpackage form
 * @author     Maximilian Lenkeit
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BasesfGuardUserProfileForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                    => new sfWidgetFormInputHidden(),
      'participant_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Participant'), 'add_empty' => true)),
      'user_id'               => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('User'), 'add_empty' => false)),
      'first_name'            => new sfWidgetFormInputText(),
      'last_name'             => new sfWidgetFormInputText(),
      'email_address'         => new sfWidgetFormInputText(),
      'chapter'               => new sfWidgetFormInputText(),
      'state_association'     => new sfWidgetFormChoice(array('choices' => array('by' => 'by', 'bw' => 'bw', 'be' => 'be', 'bb' => 'bb', 'br' => 'br', 'ha' => 'ha', 'he' => 'he', 'mp' => 'mp', 'ni' => 'ni', 'nr' => 'nr', 'rp' => 'rp', 'sr' => 'sr', 'sx' => 'sx', 'sa' => 'sa', 'sh' => 'sh', 'th' => 'th'))),
      'is_participant'        => new sfWidgetFormInputCheckbox(),
      'invoice_street'        => new sfWidgetFormInputText(),
      'invoice_zip_code'      => new sfWidgetFormInputText(),
      'invoice_city'          => new sfWidgetFormInputText(),
      'contact_phone_number'  => new sfWidgetFormInputText(),
      'contact_mobile_number' => new sfWidgetFormInputText(),
      'created_at'            => new sfWidgetFormDateTime(),
      'updated_at'            => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                    => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'participant_id'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Participant'), 'required' => false)),
      'user_id'               => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('User'))),
      'first_name'            => new sfValidatorString(array('max_length' => 255)),
      'last_name'             => new sfValidatorString(array('max_length' => 255)),
      'email_address'         => new sfValidatorString(array('max_length' => 255)),
      'chapter'               => new sfValidatorString(array('max_length' => 255)),
      'state_association'     => new sfValidatorChoice(array('choices' => array(0 => 'by', 1 => 'bw', 2 => 'be', 3 => 'bb', 4 => 'br', 5 => 'ha', 6 => 'he', 7 => 'mp', 8 => 'ni', 9 => 'nr', 10 => 'rp', 11 => 'sr', 12 => 'sx', 13 => 'sa', 14 => 'sh', 15 => 'th'), 'required' => false)),
      'is_participant'        => new sfValidatorBoolean(array('required' => false)),
      'invoice_street'        => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'invoice_zip_code'      => new sfValidatorString(array('max_length' => 5, 'required' => false)),
      'invoice_city'          => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'contact_phone_number'  => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'contact_mobile_number' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'created_at'            => new sfValidatorDateTime(),
      'updated_at'            => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('sf_guard_user_profile[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'sfGuardUserProfile';
  }

}
